<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="libxml.resources.html">« 资源类型</a></li>
      <li style="float: right;"><a href="class.libxmlerror.html">libXMLError »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.libxml.html">libxml</a></li>
    <li>预定义常量</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="libxml.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
 <dl>
  
   <dt id="constant.libxml-biglines">
    <strong><code>LIBXML_BIGLINES</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Allows line numbers greater than 65535 to be reported correctly.
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available as of PHP 7.0.0 with Libxml &gt;= 2.9.0
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-compact">
    <strong><code>LIBXML_COMPACT</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Activate small nodes allocation optimization. This may speed up your
     application without needing to change the code.
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available in Libxml &gt;= 2.6.21
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-dtdattr">
    <strong><code>LIBXML_DTDATTR</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Default DTD attributes
    </span>
   </dd>

  
  
   <dt id="constant.libxml-dtdload">
    <strong><code>LIBXML_DTDLOAD</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Load the external subset
    </span>
   </dd>

  
  
   <dt id="constant.libxml-dtdvalid">
    <strong><code>LIBXML_DTDVALID</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Validate with the DTD
    </span>
   </dd>

  
  
   <dt id="constant.libxml-html-noimplied">
    <strong><code>LIBXML_HTML_NOIMPLIED</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Sets HTML_PARSE_NOIMPLIED flag, which turns off the
     automatic adding of implied html/body... elements.
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available in Libxml &gt;= 2.7.7 (as of PHP &gt;= 5.4.0)
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-html-nodefdtd">
    <strong><code>LIBXML_HTML_NODEFDTD</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Sets HTML_PARSE_NODEFDTD flag, which prevents a default doctype
     being added when one is not found.
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available in Libxml &gt;= 2.7.8 (as of PHP &gt;= 5.4.0)
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-noblanks">
    <strong><code>LIBXML_NOBLANKS</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Remove blank nodes
    </span>
   </dd>

  
  
   <dt id="constant.libxml-nocdata">
    <strong><code>LIBXML_NOCDATA</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Merge CDATA as text nodes
    </span>
   </dd>

  
  
   <dt id="constant.libxml-noemptytag">
    <strong><code>LIBXML_NOEMPTYTAG</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Expand empty tags (e.g. <code class="literal">&lt;br/&gt;</code> to
     <code class="literal">&lt;br&gt;&lt;/br&gt;</code>)
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      This option is currently just available in the
      <a href="domdocument.save.html" class="xref">DOMDocument::save</a> and
      <a href="domdocument.savexml.html" class="xref">DOMDocument::saveXML</a> functions.
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-noent">
    <strong><code>LIBXML_NOENT</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Substitute entities
    </span>
    <div class="caution"><strong class="caution">警告</strong>
     <p class="simpara">
      Enabling entity substitution may facilitate XML External Entity (XXE) attacks.
     </p>
    </div>
   </dd>

  
  
   <dt id="constant.libxml-noerror">
    <strong><code>LIBXML_NOERROR</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Suppress error reports
    </span>
   </dd>

  
  
   <dt id="constant.libxml-nonet">
    <strong><code>LIBXML_NONET</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Disable network access when loading documents
    </span>
   </dd>

  
  
   <dt id="constant.libxml-nowarning">
    <strong><code>LIBXML_NOWARNING</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Suppress warning reports
    </span>
   </dd>

  
  
   <dt id="constant.libxml-noxmldecl">
    <strong><code>LIBXML_NOXMLDECL</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Drop the XML declaration when saving a document
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available in Libxml &gt;= 2.6.21
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-nsclean">
    <strong><code>LIBXML_NSCLEAN</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Remove redundant namespace declarations
    </span>
   </dd>

  
  
   <dt id="constant.libxml-parsehuge">
    <strong><code>LIBXML_PARSEHUGE</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Sets XML_PARSE_HUGE flag, which relaxes any hardcoded limit from the parser. This affects 
     limits like maximum depth of a document or the entity recursion, as well as limits of the 
     size of text nodes.
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available in Libxml &gt;= 2.7.0 (as of PHP &gt;= 5.3.2 and PHP &gt;= 5.2.12)
     </p>
    </p></blockquote>    
   </dd>

  
  
   <dt id="constant.libxml-pedantic">
    <strong><code>LIBXML_PEDANTIC</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Sets XML_PARSE_PEDANTIC flag, which enables pedantic error reporting.
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Available as of PHP &gt;= 5.4.0
     </p>
    </p></blockquote>
   </dd>

  
  
   <dt id="constant.libxml-xinclude">
    <strong><code>LIBXML_XINCLUDE</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Implement XInclude substitution
    </span>
   </dd>

  
  
   <dt id="constant.libxml-err-error">
    <strong><code>LIBXML_ERR_ERROR</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     A recoverable error
    </span>
   </dd>

  
  
   <dt id="constant.libxml-err-fatal">
    <strong><code>LIBXML_ERR_FATAL</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     A fatal error
    </span>
   </dd>

  
  
   <dt id="constant.libxml-err-none">
    <strong><code>LIBXML_ERR_NONE</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     No errors
    </span>
   </dd>

  
  
   <dt id="constant.libxml-err-warning">
    <strong><code>LIBXML_ERR_WARNING</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     A simple warning
    </span>
   </dd>

  
  
   <dt id="constant.libxml-version">
    <strong><code>LIBXML_VERSION</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     libxml version like 20605 or 20617
    </span>
   </dd>

  
  
   <dt id="constant.libxml-dotted-version">
    <strong><code>LIBXML_DOTTED_VERSION</code></strong>
     (<span class="type">string</span>)
   </dt>

   <dd>

    <span class="simpara">
     libxml version like 2.6.5 or 2.6.17
    </span>
   </dd>

  
  
   <dt id="constant.libxml-schema-create">
    <strong><code>LIBXML_SCHEMA_CREATE</code></strong>
     (<span class="type">int</span>)
   </dt>

   <dd>

    <span class="simpara">
     Create default/fixed value nodes during XSD schema validation
    </span>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      Only available in Libxml &gt;= 2.6.14 (as of PHP &gt;= 5.5.2)
     </p>
    </p></blockquote>    
   </dd>

  
 </dl>

</div>
</div></div></body></html>